﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data.Objects;

namespace BOOKCACHINGServiceRole
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "BookInfoService" in code, svc and config file together.
    public class BookInfoService : IBookInfoService
    {
        public Book GetBookByID(int id)
        {
//            string query = @"SELECT value User.FullName FROM BOOKCACHINGEntities.User AS User 
//                             WHERE User.UserName = @username AND User.Password = @password";
            //Book book;
            //b
            /*
            string query = @"SELECT * FROM BOOKCACHING_Azure.Book AS Book WHERE BOOK.ID = @ID";
            ObjectParameter[] parameters = new ObjectParameter[1]
            {
                new ObjectParameter("ID", id)
            };

            using (var context = new BOOKCACHING_AzureEntities())
            {
                ObjectQuery<Book> results = context.CreateQuery<Book>(query, parameters);

                foreach (Book result in results)
                {
                    if (result != null)
                    {
                        return result;
                    }
                }
            }
            */
            return null;
        }



        public void DoWork()
        {
            throw new NotImplementedException();
        }
    }
}
